﻿using System.IO;
using System.Reflection;


namespace lib472
{
    public class Datalinkini
    {
        private const string LinkName = "DatalinkDir.Ini";
        private static IniFile ini = new IniFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), LinkName));

        public static string GetString(string section, string key, string def)
        {
            return ini.GetString(section, key, def);
        }

        public static int GetInt(string section, string key, int def)
        {
            return ini.GetInt(section, key, def);
        }

        public  static void WriteInt(string section, string key, int iVal)
        {
             ini.WriteInt(section, key, iVal);
        }

        public static void WriteString(string section, string key, string strVal)
        {
             ini.WriteString(section, key, strVal);
        }

        public static bool GetBool(string section, string key, bool Default)
        {
            return ini.GetBool(section, key, Default);
        }

        public static void WriteBool(string section, string key, bool Value)
        {
            ini.WriteBool(section, key, Value);
        }


    }
}
